using MaterialUI;
using UnityEngine;

public class Example12 : MonoBehaviour
{
	private readonly Color[] m_BarColors = new Color[3]
	{
		MaterialColor.teal500,
		Color.white,
		MaterialColor.grey800
	};

	[SerializeField]
	private MaterialAppBar m_MaterialAppBar;

	public void ChangeBarColor(int i)
	{
		Color color = (i >= m_BarColors.Length) ? m_MaterialAppBar.panelGraphic.color.WithAlpha(0f) : m_BarColors[i];
		m_MaterialAppBar.SetPanelColor(color);
		m_MaterialAppBar.SetButtonsGraphicColors((!MaterialColor.LightOrDarkElements(color)) ? MaterialColor.iconDark : MaterialColor.iconLight, MaterialAppBar.ButtonElement.Icon);
		m_MaterialAppBar.SetTitleTextColor((!MaterialColor.LightOrDarkElements(color)) ? MaterialColor.textDark : MaterialColor.textLight);
	}
}
